﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LabDayAtRaces
{
    public class Bet
    {
        public static int minimumBet = 5; // The minimum bet. Needs to be static to use across classes
        public int Amount; // The amount of cash that was bet
        public int Dog; // The number of the dog that is bet on
        public Guy Bettor; // The Guy who placed the bet
        public string GetDescription()
        {
            // Return a string that says who placed the bet, how much
            // cash was bet, and which dog he bet on ("Joe bets 8 on 
            // dog #4". If the amount is zero, no bet was placed 
            // ("Joe hasn't placed a bet").
            string description;
            if (Amount == 0)
            {
                description = Bettor.Name + " has not placed a bet";
                return description;
            }
            else
            {
                description = Bettor.Name + " bets $" + Amount + " on Dog #" + Dog;
                return description;
            }
        }
        public int PayOut(int Winner)
        {
            
            // The parameter is the winner of the race. If the dog won,
            // return the amount bet. Otherwise, return the negative of 
            // the amount bet.
            if (Winner+1 == Dog) //add one to winner since the array starts at 0 but the numericUpDown goes 1-4 which is where Dog gets its number from
            {
                return Amount;
            }
            else
            {
                return -1*Amount;
            }
        }
    }
    
}
